﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoCooker3
{
    public delegate void CookStartedReply();
    public delegate void CookProgressingReply();
    public delegate int CookCompletedReply();

    class AutoCooker3
    {
        public CookStartedReply started;
        public CookProgressingReply progressing;
        public CookCompletedReply completed;

        public void DoCook()
        {
            Console.WriteLine("AutoCooker start to cook");
            if (started != null) started();

            Console.WriteLine("AutoCooker is cooking");
            if (progressing != null) progressing();

            Console.WriteLine("AutoCooker finish to Cook");
            if (completed != null)
            {
                int grade = completed();
                Console.WriteLine("My appetite is {0} %", grade);
            }
        }
    }
}
